/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page9={
    create:function () {
        var page={};
        page.ui=new PIXI.DisplayObjectContainer();

        var sp_bg=Easy.CreateSprite('assets/images/bg.png',0,0,0,0,1);
        page.ui.addChild(sp_bg);

        var arr_2=[];
        var gp=Easy.CreateJSONGroup(json_group9,page.ui);

        arr_2.push(gp.p9_t0,gp.p9_t1,gp.p9_t2,gp.p9_t3,gp.p9_t4,gp.p9_t5,gp.p9_t6);
        for(var i=0;i<arr_2.length;i++)
        {
            arr_2[i].alpha=1;
            page.ui.addChild(arr_2[i]);
        }
        document.getElementById('qr_code').addEventListener('touchstart',function (e) {
            e.preventDefault();
        })
        document.getElementById('qr_code').addEventListener('touchmove',function (e) {
            e.preventDefault();
        });
        page.ui.addChild(gp.p9_i0);
        page.ui.addChild(gp.p9_i1);
        page.ui.addChild(gp.p9_i2);



        page.In=function () {
            document.getElementById('qr_code').style.zIndex=5;
            TweenMax.to(sp_bg,1,{delay:0,alpha:1,ease:Linear.easeNone})
            TweenMax.to(document.getElementById('qr_code').style,1,{delay:1,opacity:1,ease:Linear.easeNone});

            gp.p9_i0.alpha=1;
            TweenMax.to(gp.p9_i0,1,{x:259,y:305,rotation:-5*Math.PI/180,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(gp.p9_i1,1,{x:258,y:270,rotation:-5*Math.PI/180,alpha:0,ease:Cubic.easeInOut});
            TweenMax.to(gp.p9_i2,1,{x:250,y:160,rotation:-5*Math.PI/180,alpha:1,ease:Cubic.easeInOut});

            // gp.p9_hand.y=540/2+100;
            // gp.p9_hand.alpha=0;
            // TweenMax.to(gp.p9_hand,1,{y:540/2,delay:0.7,alpha:1,ease:Back.easeOut})
            for(var i=0;i<arr_2.length;i++)
            {
                arr_2[i].scale.x=0;
                arr_2[i].scale.y=0;
                TweenMax.to(arr_2[i].scale,1,{delay:1+0.1*i,x:1,y:1,ease:Back.easeOut})
            }

        }
        page.Out=function () {
            console.log('out');

        }


        return page;
    }
}